<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"	prefix="html"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="css/calendar.css" type="text/css" rel="stylesheet"
	media="all" />
<script type="text/javascript">
	function editThConfig(paramId) {
		this.document.forms[0].thParamId.value = paramId;
		this.document.forms[0].submit();
	}
</script>
</head>
<body>
<div align="center">
<table width="800" cellspacing="0" cellpadding="0" border="0">
	<tbody>
		<tr>
			<td valign="top" style="padding: 0px; width: 100%;">
			<div class="box_region left">
			<div class="box">
			<div class="top">
			<div class="left">
			<div class="right">
			<div class="middle">
			<div class="box_title"><span class="boxtitle">Threshold Listing</span></div>
			</div>
			</div>
			</div>
			</div>
			<div class="content" align="left">
			<form action="/dbdashboard/thConfig.do?method=editThParam" method="post"><input type="hidden" name="thParamId" />
			<table width="100%"> 
				<thead>
					<th align="left" nowrap>Parameter Name</th>
					<th align="left" nowrap>Metric Name</th>
					<th align="left" nowrap>Healthy</th>
					<th align="left" nowrap>Not So Healthy</th>
					<th align="left" nowrap>Need DBA Attendtion</th>									
					<th align="center" nowrap>Edit</th>
				</thead>
				<c:forEach var="thParam" items="${ConfigList}" varStatus="count">
					<tr class="cellstatus">
						<td align="left" width="20%" nowrap class="nobright normaltext">${thParam.name}</td>
						<td align="left" width="20%" nowrap class="nobright normaltext">${thParam.metricName}</td>
						<c:if test="${!thParam.inverse}">
	                        <td align="left" width="18%" class="healthy bright divider">${thParam.minLevel} - ${thParam.warningLevel}</td>
							<td align="left" width="18%" class="warning bright divider" >${thParam.warningLevel} - ${thParam.criticalLevel}</td>						
							<td align="left" width="18%" class="critical bright divider">${thParam.criticalLevel} - ${thParam.maxLevel}</td>							
                    	</c:if>
						<c:if test="${thParam.inverse}">
	                        <td align="left" width="18%" class="healthy bright divider">${thParam.maxLevel} - ${thParam.criticalLevel}</td>
							<td align="left" width="18%" class="warning bright divider">${thParam.criticalLevel} - ${thParam.warningLevel}</td>						
							<td align="left" width="18%" class="critical bright divider">${thParam.warningLevel} - ${thParam.minLevel}</td>							
                    	</c:if>					
						<td align="center" width="6%" class="nobright normaltext">
							<button class="buttontext" onclick="editThConfig('${thParam.id}')">Edit</button>
						</td>
					</tr>
				</c:forEach>
			</table>
			</form>
			</div>
			<div class="bottom">
			<div class="left">
			<div class="right">
			<div class="middle"></div>
			</div>
			</div>
			</div>
			</div>
			</div>
			</td>
		</tr>
	</tbody>
</table>
</div>
</body>
</html>